/*
 * @Author: wuhao930406 1148547900@qq.com
 * @Date: 2023-03-02 10:59:45
 * @LastEditors: wuhao930406 1148547900@qq.com
 * @LastEditTime: 2023-10-10 14:06:07
 * @FilePath: /utools_web/config/proxy.ts
 * @Description:
 *
 * Copyright (c) 2023 by ${git_name_email}, All Rights Reserved.
 */

export default {
  devs: {
    '/apies/': {
      target: 'http://192.168.40.146:17474',
      changeOrigin: true,
      pathRewrite: { '^/apies': '' },
    },
    '/staticfile/': {
      target: 'http://tasks.youtianchen.cn/staticfile',
      changeOrigin: true,
      pathRewrite: {
        '^/staticfile': '',
      },
    },
    '/tyqw': {
      target: 'https://dashscope.aliyuncs.com/apies/v1/services/aigc/text-generation/generation',
      changeOrigin: true,
      pathRewrite: { '^/tyqw': '' },
    },
  },
  dev: {
    '/apies/': {
      target: 'http://tasks.youtianchen.cn/apies',
      changeOrigin: true,
      pathRewrite: { '^/apies': '' },
    },
    '/staticfile/': {
      target: 'http://tasks.youtianchen.cn/staticfile',
      changeOrigin: true,
      pathRewrite: {
        '^/staticfile': '',
      },
    },
    '/tyqw': {
      target: 'https://dashscope.aliyuncs.com/apies/v1/services/aigc/text-generation/generation',
      changeOrigin: true,
      pathRewrite: { '^/tyqw': '' },
    },
    '/coders': {
      target: 'https://apies.weixin.qq.com/sns/jscode2session',
      changeOrigin: true,
      pathRewrite: { '^/coders': '' },
    },
  },
  /**
   * @name 详细的代理配置
   * @doc https://github.com/chimurai/http-proxy-middleware
   */
  test: {
    '/apies/': {
      target: 'http://tasks-dev.nangaoyun.com',
      changeOrigin: true,
    },
    '/staticfile/': {
      target: 'http://192.168.40.2',
      changeOrigin: true,
      pathRewrite: {
        '^/staticfile': '',
      },
    },
    '/tyqw': {
      target: 'https://dashscope.aliyuncs.com/apies/v1/services/aigc/text-generation/generation',
      changeOrigin: true,
      pathRewrite: { '^/tyqw': '' },
    },
  },
  prod: {
    '/apies/': {
      target: 'http://tasks.youtianchen.cn/apies',
      changeOrigin: true,
      pathRewrite: { '^/apies': '' },
    },
    '/staticfile/': {
      target: 'http://tasks.youtianchen.cn/staticfile',
      changeOrigin: true,
      pathRewrite: {
        '^/staticfile': '',
      },
    },
    '/tyqw': {
      target: 'https://dashscope.aliyuncs.com/apies/v1/services/aigc/text-generation/generation',
      changeOrigin: true,
      pathRewrite: { '^/tyqw': '' },
    },
  },
};
